package com.slz3.business.module.drawManagement.draGoods.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.drawManagement.draGoods.domain.DraGoods;
import com.slz3.business.module.drawManagement.draGoods.domain.DraGoodsCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class DraGoodsResController {

    static Mono<ServerResponse> add(ServerRequest req, DraGoods draGoods) {
        if (DraGoodsResUnsafeValid.add(req, draGoods)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return DraGoodsResAtomic.add_$DraGoodsUpdateLock(req, draGoods);
        }
    }

    static final Mono<ServerResponse> delete(ServerRequest req, DraGoodsCondition draGoodsCondition) {
        if (DraGoodsResUnsafeValid.delete(req, draGoodsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return DraGoodsResAtomic.delete_$DraGoodsUpdateLock(req, draGoodsCondition);
        }
    }

    static Mono<ServerResponse> modify(ServerRequest req, DraGoods draGoods) {
        if (DraGoodsResUnsafeValid.modify(req, draGoods)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return DraGoodsResAtomic.modify_$DraGoodsUpdateLock(req, draGoods);
        }
    }

    static Mono<ServerResponse> list(ServerRequest req) {
        if (DraGoodsResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return DraGoodsResExecutor.list(req);
        }
    }

    static Mono<ServerResponse> info(ServerRequest req) {
        if (DraGoodsResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return DraGoodsResAtomic.info_$DraGoodsUpdateLock(req);
        }
    }

    static Mono<ServerResponse> choice(ServerRequest req) {
        if (DraGoodsResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return DraGoodsResExecutor.choice(req);
        }
    }

    static final Mono<ServerResponse> auditSubmit(ServerRequest req, DraGoodsCondition draGoodsCondition) {
        //
        if (DraGoodsResUnsafeValid.auditSubmit(req, draGoodsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return DraGoodsResAtomic.auditSubmit_$DraGoodsUpdateLock(req, draGoodsCondition);
        }
    }

    static final Mono<ServerResponse> audit(ServerRequest req, DraGoodsCondition draGoodsCondition) {
        if (DraGoodsResUnsafeValid.audit(req, draGoodsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return DraGoodsResAtomic.audit_$DraGoodsUpdateLock(req, draGoodsCondition);
        }
    }

    static final Mono<ServerResponse> auditReject(ServerRequest req, DraGoodsCondition draGoodsCondition) {
        if (DraGoodsResUnsafeValid.auditReject(req, draGoodsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return DraGoodsResAtomic.auditReject_$DraGoodsUpdateLock(req, draGoodsCondition);
        }
    }

    static final Mono<ServerResponse> usingEnable(ServerRequest req, DraGoodsCondition draGoodsCondition) {
        if (DraGoodsResUnsafeValid.usingEnable(req, draGoodsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return DraGoodsResAtomic.usingEnable_$DraGoodsUpdateLock(req, draGoodsCondition);
        }
    }

    static final Mono<ServerResponse> usingDisable(ServerRequest req, DraGoodsCondition draGoodsCondition) {
        if (DraGoodsResUnsafeValid.usingDisable(req, draGoodsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return DraGoodsResAtomic.usingDisable_$DraGoodsUpdateLock(req, draGoodsCondition);
        }
    }

}
